#ifndef __ASTAR_STORAGE_VECTOR3_H__
#define __ASTAR_STORAGE_VECTOR3_H__

#include <map>
#include <memory>
#include "NodeVector3.hpp"

using namespace PocketSurvival::Engine;

namespace PocketSurvival
{
    class AStarStorageVector3
    {
    public:
        std::map<Vector3, std::shared_ptr<NodeVector3>> storageMap;

        inline void clear()
        {
            storageMap.clear();
        }

        inline std::shared_ptr<NodeVector3> get(const Vector3 &p)
        {
            auto it = storageMap.find(p);
            if(it != storageMap.end())
            {
                return it->second;
            }
            return nullptr;
        }

        inline void set(const Vector3 &p, std::shared_ptr<NodeVector3> node)
        {
            storageMap[p] = node;
        }
    };
}

#endif